﻿using System;

namespace ConsoleApp1
{
    class Program
    {
        //        定义一个结构体，名为PersonStruct，有三个成员变量：姓名、电话、地址，
        //在主方法中，创建一个PersonStruct结构体对象p1，为p1的成员变量赋值。
        //再声明一个PersonStruct结构体变量p2，把p1赋值给p2，改变p2的姓名，打印p1的内容。


        struct PersonStruct
        {
            public string name;
            public string phone;
            public string add;
        }
        static void Main(string[] args)
        {
            PersonStruct p1;
            p1.name = "p1";
            p1.phone = "123456";
            p1.add = "北京";

            PersonStruct p2;
            //p2.name = "p2";
            //p2.phone = "123456789";
            //p2.add = "南京";

            p2 = p1;
            Console.WriteLine(p2.name+p2.phone+p2.add);
            Console.WriteLine("-----------------------");

            PersonClass p3 = new PersonClass();
            p3.name = "p1";
            p3.phone = "123456";
            p3.add = "北京";

            PersonClass p4 = new PersonClass();
            p4 = p3;
            Console.WriteLine(p4.name + p4.phone + p4.add);
        }
    }
}
